class Dog{
    public String name;
    public int age;

    public void eat(){
        System.out.println(name+"吃狗粮");
    }
}

public class test {
    public static void main(String[] args) {
        Dog dog=new Dog(); //对象的实例化
        dog.age=1;
        dog.name="xiaohei";
        dog.eat();
        System.out.println(dog.name);
        System.out.println(dog.age);
    }
}
